package com.eexcel.workbench.views;


import java.util.List;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

/**
 * Defines the plugin workbench view
 * @author Simão Fernandes
 * @version %I%, %G%
 * @since 1.0
 */
public class EExcelView extends ViewPart {

	/**
	 * The ID of the view as specified by the extension.
	 */
	public static final String ID = "com.eexcel.workbench.views.EExcelView";

	private TableViewer viewer;
	
	/*
	 * The content provider class is responsible for
	 * providing objects to the view. It can wrap
	 * existing objects in adapters or simply return
	 * objects as-is. These objects may be sensitive
	 * to the current input of the view, or ignore
	 * it and always show the same content 
	 * (like Task List, for example).
	 */
	 
	

	/**
	 * The constructor.
	 */
	public EExcelView() {
	}
	
	/**
	 * This is a callback that will allow us
	 * to create the viewer and initialize it.
	 * @param parent Parent instance
	 */
	public void createPartControl(Composite parent) {
		
		int numRows = 5;
		int numColumns = 26;
		
		local.pt.iscte.dcti.pa.model.WorksheetModel wsModel =
				new local.pt.iscte.dcti.pa.model.WorksheetModel(numRows, numColumns);
		
		local.pt.iscte.dcti.pa.view.WorksheetView wsView = 
				new local.pt.iscte.dcti.pa.view.WorksheetView(numRows, numColumns, parent);
		
		
		local.pt.iscte.dcti.pa.controller.WorksheetController wsController = 
				new local.pt.iscte.dcti.pa.controller.WorksheetController(wsView, wsModel);
		
	}
	
	
	
	/**
	 * Passing the focus request to the viewer's control.
	 */
	public void setFocus() {
		viewer.getControl().setFocus();
	}
}